home *** CD-ROM | disk | FTP | other *** search
/ Gekkan Dennou Club 145 / Gekkan Dennou Club - 2000.6 Vol. 145 (Japan).7z / Gekkan Dennou Club - 2000.6 Vol. 145 (Japan) (Track 1).bin / games / spassion / source.lzh / SOURCE / FuncEnemy / LBOSS.C < prev    next >
Text File  |  2000-03-29  |  27KB  |  865 lines

  1. /*
  2. #include <stdio.h>
  3. #include <iocslib.h>
  4. */
  5. /* ラストボス */
  6. #include <xsp2lib.h>
  7. #include "../SPASSION.H"
  8. #include "../player.h"
  9. #include "../enemy.h"
  10. #include "../eshot.h"
  11. #include "../effect.h"
  12. #include "../priority.h"
  13. #include "../sound.h"
  14. #include "../entry.h"
  15. #include "../SUB.H"
  16. #ifndef NULL
  17. #define NULL ((void *) 0)
  18. #endif
  19.  
  20. #define P_X    (*((short *) (&player[0].lx)))    /*lxの上位ワード*/
  21. #define P_Y    (*((short *) (&player[0].ly)))    /*lyの上位ワード*/
  22.  
  23. #define PALET_MAIN    0x0D00
  24.  
  25. static short MoveEnemyLBoss(ENEMY *);
  26. /*static void TiniEnemyLBoss(ENEMY *);*/
  27. static short MoveEnemyLCore(ENEMY *);
  28. static short MoveEnemyLBattery1(ENEMY *);
  29. static short MoveEnemyLBattery2(ENEMY *);
  30. static short MoveEnemyLBattery3(ENEMY *);
  31.  
  32. static HIT_XY4    hit_center_u_p[9]={-48-PLAYER_HIT_X,-96-PLAYER_HIT_Y, 32+PLAYER_HIT_X,    PLAYER_HIT_Y,};
  33. static HIT_XY4    hit_center_d_p[9]={-48-PLAYER_HIT_X,   -PLAYER_HIT_Y, 32+PLAYER_HIT_X, 96+PLAYER_HIT_Y,};
  34. static HIT_XY4    hit_up_p[9]=  {-40-PLAYER_HIT_X,-112-PLAYER_HIT_Y,24+PLAYER_HIT_X,-96+PLAYER_HIT_Y};
  35. static HIT_XY4    hit_down_p[9]={-40-PLAYER_HIT_X,  96-PLAYER_HIT_Y,24+PLAYER_HIT_X,112+PLAYER_HIT_Y};
  36. static HIT_XY4    hit_right_u_p[9]={40-PLAYER_HIT_X,-16-PLAYER_HIT_Y,56+PLAYER_HIT_X, 0+PLAYER_HIT_Y};
  37. static HIT_XY4    hit_right_d_p[9]={40-PLAYER_HIT_X,  0-PLAYER_HIT_Y,56+PLAYER_HIT_X,16+PLAYER_HIT_Y};
  38.  
  39. /* コア */
  40. static HIT_XY4    hit_lcore_p[4];
  41. static HIT_XY4    hit_lcore_o[4];
  42. static HIT_XY4    hit_lcore_s[4]={-8,-10,8,10, -9,-11,9,11, -10,-12,10,12, -11,-13,11,13};
  43.  
  44. static HIT_XY4    hit_battery_p;
  45. static HIT_XY4    hit_battery_o;
  46. static HIT_XY4    hit_battery_s={-7,-7,7,7};
  47.  
  48. extern HIT_XY4    nohit;
  49. static ENEMY dummy;
  50. static unsigned char seed=0;
  51.  
  52. void InitEnemyLBossHit(ENEMY *ene)
  53. {
  54.     short    i;
  55.     for(i=1;i<9;i++){
  56.         hit_center_u_p[i].x1=hit_center_u_p[0].x1    ;hit_center_u_p[i].x2=hit_center_u_p[0].x2    ;
  57.         hit_center_u_p[i].y1=hit_center_u_p[0].y1-i*4;hit_center_u_p[i].y2=hit_center_u_p[0].y2-i*4;
  58.  
  59.         hit_center_d_p[i].x1=hit_center_d_p[0].x1    ;hit_center_d_p[i].x2=hit_center_d_p[0].x2    ;
  60.         hit_center_d_p[i].y1=hit_center_d_p[0].y1+i*4;hit_center_d_p[i].y2=hit_center_d_p[0].y2+i*4;
  61.  
  62.         hit_up_p[i].x1=hit_up_p[0].x1    ;hit_up_p[i].x2=hit_up_p[0].x2    ;
  63.         hit_up_p[i].y1=hit_up_p[0].y1-i*4;hit_up_p[i].y2=hit_up_p[0].y2-i*4;
  64.  
  65.         hit_down_p[i].x1=hit_down_p[0].x1    ;hit_down_p[i].x2=hit_down_p[0].x2    ;
  66.         hit_down_p[i].y1=hit_down_p[0].y1+i*4;hit_down_p[i].y2=hit_down_p[0].y2+i*4;
  67.  
  68.         hit_right_u_p[i].x1=hit_right_u_p[0].x1    ;hit_right_u_p[i].x2=hit_right_u_p[0].x2    ;
  69.         hit_right_u_p[i].y1=hit_right_u_p[0].y1-i*4;hit_right_u_p[i].y2=hit_right_u_p[0].y2-i*4;
  70.  
  71.         hit_right_d_p[i].x1=hit_right_d_p[0].x1    ;hit_right_d_p[i].x2=hit_right_d_p[0].x2    ;
  72.         hit_right_d_p[i].y1=hit_right_d_p[0].y1+i*4;hit_right_d_p[i].y2=hit_right_d_p[0].y2+i*4;
  73.     }
  74. }
  75. void InitEnemyLCoreHit(ENEMY *ene)
  76. {
  77.     short    i;
  78.     for(i=0;i<4;i++){
  79.         hit_lcore_p[i].x1=hit_lcore_s[i].x1-PLAYER_HIT_X;hit_lcore_p[i].x2=hit_lcore_s[i].x2+PLAYER_HIT_X;
  80.         hit_lcore_p[i].y1=hit_lcore_s[i].y1-PLAYER_HIT_Y;hit_lcore_p[i].y2=hit_lcore_s[i].y2+PLAYER_HIT_Y;
  81.         hit_lcore_o[i].x1=hit_lcore_s[i].x1-OPTION_HIT_X;hit_lcore_o[i].x2=hit_lcore_s[i].x2+OPTION_HIT_X;
  82.         hit_lcore_o[i].y1=hit_lcore_s[i].y1-OPTION_HIT_Y;hit_lcore_o[i].y2=hit_lcore_s[i].y2+OPTION_HIT_Y;
  83.     }
  84. }
  85. void InitEnemyLBattery1Hit(ENEMY *ene)
  86. {
  87.     hit_battery_p.x1=hit_battery_s.x1-PLAYER_HIT_X;hit_battery_p.x2=hit_battery_s.x2+PLAYER_HIT_X;
  88.     hit_battery_p.y1=hit_battery_s.y1-PLAYER_HIT_Y;hit_battery_p.y2=hit_battery_s.y2+PLAYER_HIT_Y;
  89.     hit_battery_o.x1=hit_battery_s.x1-OPTION_HIT_X;hit_battery_o.x2=hit_battery_s.x2+OPTION_HIT_X;
  90.     hit_battery_o.y1=hit_battery_s.y1-OPTION_HIT_Y;hit_battery_o.y2=hit_battery_s.y2+OPTION_HIT_Y;
  91. }
  92. void InitEnemyLBattery2Hit(ENEMY *ene)
  93. {
  94. }
  95. void InitEnemyLBattery3Hit(ENEMY *ene)
  96. {
  97. }
  98. void InitEnemyLBoss(ENEMY *ene)
  99. {
  100.     ene->x             =ene->lx>>16;
  101.     ene->y             =ene->ly>>16;
  102.     ene->vx             = 0;
  103.     ene->vy             = 65536;
  104.     ene->hit_p[0]     = &hit_center_u_p[0]; ene->hit_p[1] = &hit_center_d_p[0]; 
  105.     ene->hit_p[2]     = &hit_up_p[0]; ene->hit_p[3] = &hit_down_p[0]; 
  106.     ene->hit_p[4]     = &hit_right_u_p[0]; ene->hit_p[5] = &hit_right_d_p[0]; ene->hit_p[6] = NULL;
  107.  
  108.     ene->hit_o[0]     = &nohit; ene->hit_o[1] = &nohit; 
  109.     ene->hit_o[2]     = &nohit; ene->hit_o[3] = &nohit; 
  110.     ene->hit_o[4]     = &nohit; ene->hit_o[5] = &nohit; ene->hit_s[6] = NULL;
  111.  
  112.     ene->hit_s[0]     = &nohit; ene->hit_s[1] = &nohit; 
  113.     ene->hit_s[2]     = &nohit; ene->hit_s[3] = &nohit; 
  114.     ene->hit_s[4]     = &nohit; ene->hit_s[5] = &nohit; ene->hit_s[6] = NULL;
  115.  
  116.     ene->pt             = obj_lboss;
  117.     ene->info         = PALET_MAIN | PRIORITY_BOSS;
  118.     ene->no_dead     = 0;
  119.     ene->func_enemy_move = MoveEnemyLBoss;
  120. /*    ene->func_enemy_tini = TiniEnemyLBoss;*/
  121.     ene->parts3=MakeEnemy(ENEMY_LCORE , ene->x-8, ene->y   ,0,  ene);    /* コア */
  122. #if 1
  123.     MakeEnemy(ENEMY_LBATTERY1 , ene->x+20, ene->y-24   ,0,  ene);    /* 砲台 */
  124.     MakeEnemy(ENEMY_LBATTERY2 , ene->x+18, ene->y-40   ,0,  ene);
  125.     MakeEnemy(ENEMY_LBATTERY2 , ene->x+16, ene->y-56   ,0,  ene);
  126.     MakeEnemy(ENEMY_LBATTERY3 , ene->x+14, ene->y-72   ,0,  ene);
  127.     MakeEnemy(ENEMY_LBATTERY1 , ene->x-20, ene->y-24   ,1,  ene);    /* 砲台 */
  128.     MakeEnemy(ENEMY_LBATTERY2 , ene->x-18, ene->y-40   ,1,  ene);
  129.     MakeEnemy(ENEMY_LBATTERY2 , ene->x-16, ene->y-56   ,1,  ene);
  130.     MakeEnemy(ENEMY_LBATTERY3 , ene->x-14, ene->y-72   ,1,  ene);
  131.     MakeEnemy(ENEMY_LBATTERY1 , ene->x+20, ene->y+24   ,2,  ene);    /* 砲台 */
  132.     MakeEnemy(ENEMY_LBATTERY2 , ene->x+18, ene->y+40   ,2,  ene);
  133.     MakeEnemy(ENEMY_LBATTERY2 , ene->x+16, ene->y+56   ,2,  ene);
  134.     MakeEnemy(ENEMY_LBATTERY3 , ene->x+14, ene->y+72   ,2,  ene);
  135.     MakeEnemy(ENEMY_LBATTERY1 , ene->x-20, ene->y+24   ,3,  ene);    /* 砲台 */
  136.     MakeEnemy(ENEMY_LBATTERY2 , ene->x-18, ene->y+40   ,3,  ene);
  137.     MakeEnemy(ENEMY_LBATTERY2 , ene->x-16, ene->y+56   ,3,  ene);
  138.     MakeEnemy(ENEMY_LBATTERY3 , ene->x-14, ene->y+72   ,3,  ene);
  139. #endif
  140.     ene->work=0;
  141.     ene->work2=0;
  142.     ene->work3=0;
  143.     ene->child = &dummy;            /* 仮のパーツ */
  144.  
  145.     entry_counter_stop = !0;        /* エントリーカウンター停止 */
  146. }
  147.  
  148. void InitEnemyLCore(ENEMY *ene)
  149. {
  150.     ene->pt             = obj_lboss+1;
  151.     ene->info         = PALET_MAIN | PRIORITY_BOSS_PARTS;
  152.     ene->hit_p[1]     = NULL;
  153.     ene->hit_o[1]     = NULL;
  154.     ene->hit_s[1]     = NULL;
  155.     ene->hp             = 1000;
  156.     ene->no_dead     = 0;
  157.     ene->func_enemy_move = MoveEnemyLCore;
  158. /*    ene->func_enemy_tini = TiniEnemyLBoss;*/
  159.     ene->parts1 = ene->parts2 = &dummy;        /* 腕が出てくるまでの仮のパーツ */
  160.     dummy.child_death =1;
  161. }
  162.  
  163. void InitEnemyLBattery1(ENEMY *ene)
  164. {
  165.     ene->pt             = obj_obj+0x22;
  166.     ene->info         = PALET_MAIN | PRIORITY_BOSS_PARTS;
  167.     ene->hit_p[0]     = &hit_battery_p;ene->hit_p[1] = NULL;
  168.     ene->hit_o[0]     = &hit_battery_o;ene->hit_o[1] = NULL;
  169.     ene->hit_s[0]     = &hit_battery_s;ene->hit_s[1] = NULL;
  170.     ene->hp             = 100;
  171.     ene->no_dead     = 0;
  172.     ene->move_ax     = ene->lx-ene->parent->lx;
  173.     ene->move_ay     = ene->ly-ene->parent->ly;
  174.     ene->func_enemy_move = MoveEnemyLBattery1;
  175. /*    ene->func_enemy_tini = TiniEnemyLBoss;*/
  176. }
  177. void InitEnemyLBattery2(ENEMY *ene)
  178. {
  179.     ene->pt             = obj_obj+0x28;
  180.     ene->info         = PALET_MAIN | PRIORITY_BOSS_PARTS;
  181.     ene->hit_p[0]     = &hit_battery_p;ene->hit_p[1] = NULL;
  182.     ene->hit_o[0]     = &hit_battery_o;ene->hit_o[1] = NULL;
  183.     ene->hit_s[0]     = &hit_battery_s;ene->hit_s[1] = NULL;
  184.     ene->hp             = 100;
  185.     ene->no_dead     = 0;
  186.     ene->move_ax     = ene->lx-ene->parent->lx;
  187.     ene->move_ay     = ene->ly-ene->parent->ly;
  188.     ene->func_enemy_move = MoveEnemyLBattery2;
  189. /*    ene->func_enemy_tini = TiniEnemyLBoss;*/
  190. }
  191. void InitEnemyLBattery3(ENEMY *ene)
  192. {
  193.     ene->pt             = obj_obj+0x30;
  194.     ene->info         = PALET_MAIN | PRIORITY_BOSS_PARTS;
  195.     ene->hit_p[0]     = &hit_battery_p;ene->hit_p[1] = NULL;
  196.     ene->hit_o[0]     = &hit_battery_o;ene->hit_o[1] = NULL;
  197.     ene->hit_s[0]     = &hit_battery_s;ene->hit_s[1] = NULL;
  198.     ene->hp             = 100;
  199.     ene->no_dead     = 0;
  200.     ene->move_ax     = ene->lx-ene->parent->lx;
  201.     ene->move_ay     = ene->ly-ene->parent->ly;
  202.     ene->func_enemy_move = MoveEnemyLBattery3;
  203. /*    ene->func_enemy_tini = TiniEnemyLBoss;*/
  204. }
  205.  
  206. static short MoveEnemyLBoss( ENEMY *ene )
  207. {
  208.     short    anim_num,flg;
  209. /*    ESHOT    *eshot;*/
  210.     short Wait( ENEMY *ene, short time );
  211.  
  212.     /* 爆発 */
  213.     if( ene->dead_count ){
  214.         ene->dead_count++;
  215.         if( ene->y > 256+128+48+16 ){
  216.             entry_counter_stop = 0;    /* エントリーカウンター停止解除 */
  217.             return (0);        /* 消去 */
  218.         }else if( ene->y > 256+128+16 ){
  219.             ene->y = (ene->ly += 65536/2) >> 16;
  220.             return (1);
  221.         }else{
  222.             if( !(ene->dead_count%20) ){
  223.                 short    exp_x,exp_y,x,y;
  224.                 exp_x=rndtable[seed++]&127;seed&=255;
  225.                 exp_y=rndtable[seed++];    seed&=255;
  226.                 MakeEffect(EFFECT_EXPL, 0, (x=ene->x-64+exp_x), (y=ene->y-128+exp_y));
  227.                 MakeEffect(EFFECT_HAHENMINI, 0, x, y);
  228.                 SetSE(SE_EXPL_BOSS);    /* 爆発音 */
  229.                 if( !(ene->dead_count%60) ){
  230.                     MakeEffect(EFFECT_EXPLL, 0, ene->x, ene->y);
  231.                     MakeEffect (EFFECT_HAHEN, 0, ene->x, ene->y);
  232.                     SetSE(SE_EXPL_LBOSS);    /* 爆発音 */
  233.                 }
  234.             }
  235.             ene->y = (ene->ly += 65536/2) >> 16;
  236.             if( ene->pt > obj_lboss ){
  237.                 if( ++ene->anim_count>8 ){
  238.                     ene->anim_count=0;
  239.                     ene->pt--;
  240.                 }
  241.             }
  242.             xobj_set_st(ene);
  243.             return (1);
  244.         }
  245.     }
  246.  
  247.     /* 速度を足して上位ワード(固定整数部)だけ取り出す */
  248.     ene->x = (ene->lx += ene->vx) >> 16;
  249.     ene->y = (ene->ly += ene->vy) >> 16;
  250.  
  251.     ene->parts3->x=((ene->parts3->lx=ene->lx        )>>16);
  252.     ene->parts3->y=((ene->parts3->ly=ene->ly        )>>16);
  253.  
  254.     flg=ene->flg;
  255.     if( !ene->parts3->child_death ){
  256.         /* 腕が片方でも生きてればゆっくり動く */
  257.         if( !ene->parts3->parts1->child_death || !ene->parts3->parts2->child_death )
  258.             flg=0;
  259.     }
  260.     switch (ene->state){
  261.     case 0:
  262.         switch (ene->work){
  263.         case 0:        /* 画面右、上から下へ */
  264.             if( ENE_Y > 0+16 ){
  265.                 ene->vy = 65536/2+(65536/2)*flg;            /* スピードを落とす */
  266.                 if( ENE_Y > 256+16 ){
  267.                     ene->vy = 65536+65536*flg;                /* スピードを上げる */
  268.                     if( ENE_Y > 256+128+64+16 ){
  269.                         ene->lx = (0+16)<<16;
  270.                         ene->vy = -65536-65536*flg;
  271.                         ene->work++;
  272.                         if( rndtable[seed++]>128||player[0].pow_lev==0 ){
  273.                             seed&=255;
  274.                             MakeEnemy(ENEMY_ZAKO04, 256+24, rndtable[seed++]+16, 0,  ene);
  275.                             seed&=255;
  276.                         }
  277.                     }
  278.                 }
  279.             }
  280. #if 0
  281.             ene->work=2;
  282.             ene->lx = (256+16)<<16;
  283.             ene->ly = (128+16)<<16;
  284.             ene->vx = (-1)<<16;
  285.             ene->vy = 0;
  286. #endif
  287.             break;
  288.         case 1:        /* 画面左、下から上へ */
  289.             if( ENE_Y < 256+16 ){
  290.                 ene->vy = -65536/2-(65536/2)*flg;        /* スピードを落とす */
  291.                 if( ENE_Y < 0+16 ){
  292.                     ene->vy = -65536-65536*flg;            /* スピードを上げる */
  293.                     if( ENE_Y < 0-128-64+16 ){
  294.                         ene->lx = (256+48+16)<<16;
  295.                         ene->ly = (128+16)<<16;
  296.                         ene->vx = -65536-65536*flg;
  297.                         ene->vy = 0;
  298.                         ene->work++;
  299.                     }
  300.                 }
  301.             }
  302.             break;
  303.         case 2:        /* 画面右から中央へ */
  304.             if( ENE_X < 256-48+16 ){
  305. /*            if( ENE_X < 128+16 ){*/
  306.                 ene->vx = 0;
  307.                 ene->work++;
  308.             }
  309.             break;
  310.         case 3:        /* 分離 */
  311.             anim_num=(++ene->anim_count)/8;
  312.             ene->pt = obj_lboss+anim_num;
  313.             ene->hit_p[0] = &hit_center_u_p[anim_num];
  314.             ene->hit_p[1] = &hit_center_d_p[anim_num];
  315.             ene->hit_p[2] = &hit_up_p[anim_num];
  316.             ene->hit_p[3] = &hit_down_p[anim_num];
  317.             ene->hit_p[4] = &hit_right_u_p[anim_num];
  318.             ene->hit_p[5] = &hit_right_d_p[anim_num];
  319.             if( anim_num == 8 ){
  320.                 ene->work++;
  321.                 ene->vx = -65536/2-(65536/2)*flg;
  322. #if 0
  323.                     ene->work++;
  324.                     ene->vx = 0;
  325. #endif
  326.             }
  327.             break;
  328.         case 4:
  329.             if( ENE_X < 0+48+16 ){
  330.                 ene->vx = 0;
  331.                 ene->work++;
  332.             }
  333.             break;
  334.         case 5:        /* 合体 */
  335.             anim_num=(--ene->anim_count)/8;
  336.             ene->pt = obj_lboss+anim_num;
  337.             ene->hit_p[0] = &hit_center_u_p[anim_num];
  338.             ene->hit_p[1] = &hit_center_d_p[anim_num];
  339.             ene->hit_p[2] = &hit_up_p[anim_num];
  340.             ene->hit_p[3] = &hit_down_p[anim_num];
  341.             ene->hit_p[4] = &hit_right_u_p[anim_num];
  342.             ene->hit_p[5] = &hit_right_d_p[anim_num];
  343.             if( anim_num == 0 ){
  344.                 MakeEffect(EFFECT_TITSPARK, 0, ene->x, ene->y);
  345.                 MakeEffect(EFFECT_TITSPARK, 1, ene->x, ene->y);
  346.                 SetSE(SE_TRANSFORM);    /* 衝撃音 */
  347.                 ene->work++;
  348.                 ene->vx = -65536-65536*flg;
  349.             }
  350.             break;
  351.         case 6:
  352. /* 腕の分も移動、腕が伸びきるまで待つ */
  353. /*            if( (ENE_X < 0-5*32+16 && (ene->parts3->parts1->child_death && ene->parts3->parts2->child_death))
  354.              || (!ene->parts3->parts1->child_death && ene->parts3->parts1->state>=2 )
  355.              || (!ene->parts3->parts2->child_death && ene->parts3->parts2->state>=2 )){
  356. */
  357.             if( ENE_X < 0-5*32+16 ){
  358.                 ene->vx = 65536+65536*flg;
  359.                 ene->work++;
  360.             }
  361.             break;
  362.         case 7:        /* 画面左から中央へ */
  363.             if( ENE_X > 0+48+16 ){
  364.                 ene->vx = 0;
  365.                 ene->work++;
  366.             }
  367.             break;
  368.         case 8:        /* 分離 */
  369.             anim_num=(++ene->anim_count)/8;
  370.             ene->pt = obj_lboss+anim_num;
  371.             ene->hit_p[0] = &hit_center_u_p[anim_num];
  372.             ene->hit_p[1] = &hit_center_d_p[anim_num];
  373.             ene->hit_p[2] = &hit_up_p[anim_num];
  374.             ene->hit_p[3] = &hit_down_p[anim_num];
  375.             ene->hit_p[4] = &hit_right_u_p[anim_num];
  376.             ene->hit_p[5] = &hit_right_d_p[anim_num];
  377.             if( anim_num == 8 ){
  378.                 ene->work++;
  379.                 ene->vx = 65536/2+(65536/2)*flg;
  380.             }
  381.             break;
  382.         case 9:
  383.             if( ENE_X > 256-48+16 ){
  384.                 ene->vx = 0;
  385.                 ene->work++;
  386.             }
  387.             break;
  388.         case 10:        /* 合体 */
  389.             anim_num=(--ene->anim_count)/8;
  390.             ene->pt = obj_lboss+anim_num;
  391.             ene->hit_p[0] = &hit_center_u_p[anim_num];
  392.             ene->hit_p[1] = &hit_center_d_p[anim_num];
  393.             ene->hit_p[2] = &hit_up_p[anim_num];
  394.             ene->hit_p[3] = &hit_down_p[anim_num];
  395.             ene->hit_p[4] = &hit_right_u_p[anim_num];
  396.             ene->hit_p[5] = &hit_right_d_p[anim_num];
  397.  
  398.             if( anim_num == 0 ){
  399.                 MakeEffect(EFFECT_TITSPARK, 0, ene->x, ene->y);
  400.                 MakeEffect(EFFECT_TITSPARK, 1, ene->x, ene->y);
  401.                 SetSE(SE_TRANSFORM);    /* 衝撃音 */
  402.                 ene->work++;
  403.                 ene->vx = 65536+65536*flg;
  404.             }
  405.             break;
  406.         case 11:
  407. /* 腕の分も移動、腕が伸びきるまで待つ */
  408.             if( ENE_X > 256+5*32+16 ){
  409.             if( (ene->parts3->parts1->child_death && ene->parts3->parts2->child_death)
  410.              || (!ene->parts3->parts1->child_death && ene->parts3->parts1->state>=2 )
  411.              || (!ene->parts3->parts2->child_death && ene->parts3->parts2->state>=2 )){
  412.  
  413.                 if( ++ene->flg>2 )ene->flg=2;        /* 移動速度を上げる */
  414.                 ene->child=&dummy;
  415.                 if( ene->parts3->hp<500 && ene->work2<=3 ){
  416.                     /* 各面のボスを出す */
  417.                     switch( ene->work2 ){
  418.                     case 0:
  419.                         ene->child=MakeEnemy(ENEMY_BOSS01 , 256+64  , 128+16, 0,  ene);
  420.                         break;
  421.                     case 1:
  422.                         ene->child=MakeEnemy(ENEMY_BOSS02 , 256+64  , 128+16, 0,  ene);
  423.                         break;
  424.                     case 2:
  425.                         ene->child=MakeEnemy(ENEMY_BOSS03 , 256+64  , 128+16, 0,  ene);
  426.                         break;
  427.                     case 3:
  428.                         ene->child=MakeEnemy(ENEMY_BOSS04 , 256+64  , 128+16, 0,  ene);
  429.                         break;
  430.                     }
  431.                     ene->work3=1;
  432. /*
  433.                     if(!ene->child){
  434.                         printf("NoMake\n");
  435.                         key_wait();
  436.                     }
  437. */
  438.                     ene->work2++;
  439.                     ene->parts3->flg=0;
  440.                     ene->parts3->hp=1000;
  441.                 }
  442.                 ene->work++;
  443.             }}
  444.             break;
  445.         case 12:    /* さっき出したボスが死んだら、繰り返し */
  446.             if( ene->child->child_death ){
  447.                 ene->child->child_kill=1;
  448.                 ene->work3=0;
  449.                 ene->lx = (256+16)<<16;
  450.                 ene->ly = (-128+16)<<16;
  451.                 ene->vx = 0;
  452.                 ene->vy = 65536+65536*flg;
  453.                 ene->work=0;
  454. #if 0
  455.                     ene->work=2;
  456.                     ene->lx = (256+16)<<16;
  457.                     ene->ly = (128+16)<<16;
  458.                     ene->vx = (-1)<<16;
  459.                     ene->vy = 0;
  460. #endif
  461.             }
  462.             break;
  463.         }
  464.         break;
  465.     }
  466.  
  467.  
  468. #if 0
  469.             ene->state = 1;
  470.             ene->lx = 128*65536;
  471.             ene->ly = 128*65536;
  472.             ene->vx = 0;
  473.             ene->vy = 0;
  474.             if( BITSNS(0x04) & BIT(1) ){
  475.                 while( BITSNS(0x04) & BIT(1) );
  476.                 entry_counter_stop = 0;
  477.                 return (0);
  478.             }
  479. #endif
  480.  
  481.     /* コアが破壊された */
  482.     if( ene->parts3->child_death ){
  483.         MakeEffect(EFFECT_EXPLL, 0, ene->x, ene->y);
  484.         SetSE(SE_EXPL_LBOSS);    /* 爆発音 */
  485.         MakeEffect(EFFECT_HAHEN, 0, ene->x, ene->y);
  486.         if(!eshot_erase)
  487.             eshot_erase = ESHOT_ERASE;    /* 弾消し */
  488.         ene->player->score += 30;
  489.         ene->parts1->child_kill=1;
  490.         ene->parts2->child_kill=1;
  491.         ene->hit_p[0]=NULL;
  492.         ene->dead_count=1;
  493.         ene->child_death=1;
  494.     }
  495.  
  496.     xobj_set_st(ene);
  497.     xobj_set_st(ene->parts3);
  498.  
  499.     return(1);
  500. }
  501.  
  502. static short MoveEnemyLCore( ENEMY *ene )
  503. {
  504.     short    anim_num;
  505.  
  506.     if( ene->child_death ){
  507.         if( ene->parent->dead_count )
  508.             return (0);        /* 消去 */
  509.         else
  510.             return(1);
  511.     }
  512.  
  513.     anim_num=(++ene->anim_count)/4;
  514.     if( anim_num == 4 ){
  515.         ene->anim_count=0;
  516.         anim_num=0;
  517.     }
  518.     ene->pt         = obj_lboss+9+anim_num;
  519.     ene->hit_p[0]=&hit_lcore_p[anim_num];
  520.     ene->hit_o[0]=&hit_lcore_o[anim_num];
  521.     ene->hit_s[0]=&hit_lcore_s[anim_num];
  522.  
  523.     if( ene->parts1->child_death )ene->parts1->child_kill=1;
  524.     if( ene->parts2->child_death )ene->parts2->child_kill=1;
  525.  
  526.     /* ダメージを受けた時の処理 */
  527.     if(ene->damage){
  528.         SetSE(SE_CORE_DAMAGE);    /* 効果音 */
  529.         ene->info = PALET_DAMAGE | PRIORITY_BOSS_PARTS;
  530.         ene->hp -= ene->damage;
  531.         if( ene->hp <= 0 
  532.          && ene->parts1->child_death && ene->parts2->child_death 
  533.          && ene->parent->work2>=4 
  534.          && (ene->parent->work==4 || ene->parent->work==9) ){
  535.             MakeEffect(EFFECT_EXPL, 0, ene->x+8, ene->y+8);
  536.             SetSE(SE_EXPL_MBOSS);    /* 爆発音 */
  537.             if(disp_level == DISP_LEVEL_HIGH)
  538.                 MakeEffect (EFFECT_HAHEN, 0, ene->x, ene->y);
  539.             if(!eshot_erase)
  540.                 eshot_erase = ESHOT_ERASE;    /* 弾消し */
  541.             ene->player->score += 20;
  542.             ene->child_death = 1;
  543. /*            ene->info=0xE00;*/            /* 見えなくする */
  544.             ene->parts1->child_kill=1;
  545.             ene->parts2->child_kill=1;
  546.             ene->hit_p[0]=NULL;
  547.         }
  548.         ene->damage = 0;
  549.     }else
  550.         ene->info = PALET_MAIN | PRIORITY_BOSS_PARTS;
  551.  
  552.         if( !ene->flg   && ene->hp<500 )ene->hp=500-1;
  553.         if( ene->flg==1 && ene->hp<  0 )ene->hp=    0;
  554.         if(level>=NOMAL){
  555.             if( !ene->flg && ene->hp<500 && ene->parts1->child_death && ene->parts2->child_death 
  556.              && ene->parent->work==10 ){
  557.                 ene->flg++;
  558.                 ene->parts1=MakeEnemy(ENEMY_BOSSARM, ENE_X, ENE_Y,0x1004, ene);
  559.                 ene->parts2=MakeEnemy(ENEMY_BOSSARM, ENE_X, ENE_Y,0x1104, ene);
  560.             }
  561.         }else{
  562.             if( !ene->flg && ene->hp<500 )
  563.                 ene->flg++;
  564.         }
  565. /*
  566. B_LOCATE(0,0);
  567. printf("%4d\n",ene->hp);
  568. printf("cd1=%d cd2=%d\n",ene->parts1->child_death,ene->parts2->child_death);
  569. */
  570.     return 1;
  571. }
  572.  
  573. static short MoveEnemyLBattery1( ENEMY *ene )
  574. {
  575.     short    anim_num,angle,p_anim_num;
  576.     short    info[4]={0x0,0x4000,0x8000,0xC000};
  577.     int        y[4][9]={
  578.         0,-4*65536,-8*65536,-12*65536,-16*65536, -20*65536,-24*65536,-28*65536,-32*65536,
  579.         0,-4*65536,-8*65536,-12*65536,-16*65536, -20*65536,-24*65536,-28*65536,-32*65536,
  580.         0,+4*65536,+8*65536,+12*65536,+16*65536, +20*65536,+24*65536,+28*65536,+32*65536,
  581.         0,+4*65536,+8*65536,+12*65536,+16*65536, +20*65536,+24*65536,+28*65536,+32*65536
  582.     };
  583.     short Wait( ENEMY *ene, short time );
  584.  
  585.     if( ene->child_death ){
  586.         if( ene->parent->child_death )
  587.             return (0);        /* 消去 */
  588.         else{
  589.             if( ene->parent->work3 ){    /* ラスボス復帰で砲台も復活 */
  590.                 p_anim_num=ene->parent->pt-obj_lboss;
  591.                 ene->x = ((ene->lx = ene->parent->lx+ene->move_ax) >> 16)-8;    /*-8は表示位置をずらすため*/
  592.                 ene->y = ((ene->ly = ene->parent->ly+ene->move_ay+y[ene->arg][p_anim_num]) >> 16)-8;
  593.                 ene->hp=100;
  594.                 ene->hit_p[0] = &hit_battery_p;
  595.                 ene->child_death=0;
  596.             }
  597.             return(1);
  598.         }
  599.     }
  600.  
  601.     /* 上位ワード(固定整数部)だけ取り出す */
  602.     p_anim_num=ene->parent->pt-obj_lboss;
  603.     ene->x = ((ene->lx = ene->parent->lx+ene->move_ax) >> 16)-8;    /*-8は表示位置をずらすため*/
  604.     ene->y = ((ene->ly = ene->parent->ly+ene->move_ay+y[ene->arg][p_anim_num]) >> 16)-8;
  605.  
  606.     switch (ene->work){
  607.     case 0:        /* 砲身を向ける */
  608.         anim_num=(++ene->anim_count)/8;
  609.         ene->pt = obj_obj+0x22+anim_num;
  610.         if( anim_num == 5 ){
  611.             ene->anim_count=6*8;
  612.             ene->work++;
  613.         }
  614.         break;
  615.     case 1:        /* 砲身を戻す */
  616.         anim_num=(--ene->anim_count)/8;
  617.         ene->pt = obj_obj+0x22+anim_num;
  618.         if( anim_num == 0 ){
  619.             ene->anim_count=0;
  620.             ene->work++;
  621.             /* 画面外では撃たない */
  622.             if( ENE_X < 16-8 || ENE_X > 255+24 || ENE_Y < 16-8 || ENE_Y > 255+24 )
  623.                 ene->work++;
  624.         }
  625.         break;
  626.     case 2:        /* 拡散弾 */
  627.         MakeEShot(ESHOT_LASER00, ENE_X, ENE_Y, 5, angle=calc_direction( ENE_X, ENE_Y, P_X+CENTER_X, P_Y ), 4,0,ene);
  628.         if(level>=NOMAL){
  629.             MakeEShot(ESHOT_LASER00, ENE_X, ENE_Y, 5, (angle-16)&255, 4,0,ene);
  630.             MakeEShot(ESHOT_LASER00, ENE_X, ENE_Y, 5, (angle+16)&255, 4,0,ene);
  631.         }
  632.         SetSE(SE_ESHOT_LASER);    /* 敵ショット音 */
  633.         ene->work++;
  634.         break;
  635.     case 3:        /* 時間稼ぎ */
  636.         if( Wait( ene, 30 ) )
  637.             ene->work=0;
  638.         break;
  639.     }
  640.  
  641.     if( ene->parent->child_death )        /* ラスボスが死んだら砲台も死ぬ */
  642.         ene->damage=100;
  643.     /* ダメージを受けた時の処理 */
  644.     if(ene->damage){
  645.         SetSE(SE_DAMAGE);    /* 効果音 */
  646.         ene->info = PALET_DAMAGE | PRIORITY_BOSS_PARTS | info[ene->arg];
  647.         if( (ene->hp -= ene->damage) <= 0 ){
  648.             MakeEffect(EFFECT_EXPL, 0, ene->x+8, ene->y+8);
  649.             SetSE(SE_EXPL_MBOSS);    /* 爆発音 */
  650.             if(!eshot_erase)
  651.                 eshot_erase = ESHOT_ERASE;    /* 弾消し */
  652.             ene->player->score += 5;
  653.             ene->child_death = 1;
  654. /*            ene->info=0xE00;*/            /* 見えなくする */
  655.             ene->hit_p[0]=NULL;
  656.         }
  657.         ene->damage = 0;
  658.     }else
  659.         ene->info = PALET_MAIN | PRIORITY_BOSS_PARTS | info[ene->arg];
  660.  
  661.     xsp_set_st(ene);
  662.  
  663.     return 1;
  664. }
  665.  
  666. static short MoveEnemyLBattery2( ENEMY *ene )
  667. {
  668.     short    anim_num,angle,p_anim_num;
  669.     short    info[4]={0x0,0x4000,0x8000,0xC000};
  670.     int        y[4][9]={
  671.         0,-4*65536,-8*65536,-12*65536,-16*65536, -20*65536,-24*65536,-28*65536,-32*65536,
  672.         0,-4*65536,-8*65536,-12*65536,-16*65536, -20*65536,-24*65536,-28*65536,-32*65536,
  673.         0,+4*65536,+8*65536,+12*65536,+16*65536, +20*65536,+24*65536,+28*65536,+32*65536,
  674.         0,+4*65536,+8*65536,+12*65536,+16*65536, +20*65536,+24*65536,+28*65536,+32*65536
  675.     };
  676.     short Wait( ENEMY *ene, short time );
  677.  
  678.     if( ene->child_death ){
  679.         if( ene->parent->child_death )
  680.             return (0);        /* 消去 */
  681.         else{
  682.             if( ene->parent->work3 ){    /* ラスボス復帰で砲台も復活 */
  683.                 p_anim_num=ene->parent->pt-obj_lboss;
  684.                 ene->x = ((ene->lx = ene->parent->lx+ene->move_ax) >> 16)-8;    /*-8は表示位置をずらすため*/
  685.                 ene->y = ((ene->ly = ene->parent->ly+ene->move_ay+y[ene->arg][p_anim_num]) >> 16)-8;
  686.                 ene->hp=100;
  687.                 ene->hit_p[0] = &hit_battery_p;
  688.                 ene->child_death=0;
  689.             }
  690.             return(1);
  691.         }
  692.     }
  693.  
  694.     /* 上位ワード(固定整数部)だけ取り出す */
  695.     p_anim_num=ene->parent->pt-obj_lboss;
  696.     ene->x = ((ene->lx = ene->parent->lx+ene->move_ax) >> 16)-8;    /*-8は表示位置をずらすため*/
  697.     ene->y = ((ene->ly = ene->parent->ly+ene->move_ay+y[ene->arg][p_anim_num]) >> 16)-8;
  698.  
  699.     switch (ene->work){
  700.     case 0:        /* 砲身を向ける */
  701.         anim_num=(++ene->anim_count)/8;
  702.         ene->pt = obj_obj+0x28+anim_num;
  703.         if( anim_num == 7 ){
  704.             ene->work++;
  705.             /* 画面外では撃たない */
  706.             if( ENE_X < 16-8 || ENE_X > 255+24 || ENE_Y < 16-8 || ENE_Y > 255+24 )
  707.                 ene->work++;
  708.         }
  709.         break;
  710.     case 1:        /* 拡散弾 */
  711.         MakeEShot(ESHOT_ENERGY03, ENE_X, ENE_Y, 5, angle=calc_direction( ENE_X, ENE_Y, P_X+CENTER_X, P_Y ), 4,0,ene);
  712.         if(level>=NOMAL){
  713.             MakeEShot(ESHOT_ENERGY03, ENE_X, ENE_Y, 5, (angle-16)&255, 4,0,ene);
  714.             MakeEShot(ESHOT_ENERGY03, ENE_X, ENE_Y, 5, (angle+16)&255, 4,0,ene);
  715.         }
  716.         SetSE(SE_ESHOT_ENRG);    /* 敵ショット音 */
  717.         ene->work++;
  718.         break;
  719.     case 2:        /* 時間稼ぎ */
  720.         if( Wait( ene, 30 ) )
  721.             ene->work++;
  722.         break;
  723.     case 3:        /* 砲身を戻す */
  724.         anim_num=(--ene->anim_count)/8;
  725.         ene->pt = obj_obj+0x28+anim_num;
  726.         if( anim_num == 0 ){
  727.             ene->anim_count=0;
  728.             ene->work++;
  729.         }
  730.         break;
  731.     case 4:        /* 時間稼ぎ */
  732.         if( Wait( ene, 30 ) )
  733.             ene->work=0;
  734.         break;
  735.     }
  736.  
  737.     if( ene->parent->child_death )        /* ラスボスが死んだら砲台も死ぬ */
  738.         ene->damage=100;
  739.     /* ダメージを受けた時の処理 */
  740.     if(ene->damage){
  741.         SetSE(SE_DAMAGE);    /* 効果音 */
  742.         ene->info = PALET_DAMAGE | PRIORITY_BOSS_PARTS | info[ene->arg];
  743.         if( (ene->hp -= ene->damage) <= 0 ){
  744.             MakeEffect(EFFECT_EXPL, 0, ene->x+8, ene->y+8);
  745.             SetSE(SE_EXPL_MBOSS);    /* 爆発音 */
  746.             if(!eshot_erase)
  747.                 eshot_erase = ESHOT_ERASE;    /* 弾消し */
  748.             ene->player->score += 5;
  749.             ene->child_death = 1;
  750. /*            ene->info=0xE00;*/            /* 見えなくする */
  751.             ene->hit_p[0]=NULL;
  752.         }
  753.         ene->damage = 0;
  754.     }else
  755.         ene->info = PALET_MAIN | PRIORITY_BOSS_PARTS | info[ene->arg];
  756.  
  757.     xsp_set_st(ene);
  758.  
  759.     return 1;
  760. }
  761.  
  762. static short MoveEnemyLBattery3( ENEMY *ene )
  763. {
  764.     short    anim_num,angle,p_anim_num;
  765.     short    info[4]={0x0,0x4000,0x8000,0xC000};
  766.     int        y[4][9]={
  767.         0,-4*65536,-8*65536,-12*65536,-16*65536, -20*65536,-24*65536,-28*65536,-32*65536,
  768.         0,-4*65536,-8*65536,-12*65536,-16*65536, -20*65536,-24*65536,-28*65536,-32*65536,
  769.         0,+4*65536,+8*65536,+12*65536,+16*65536, +20*65536,+24*65536,+28*65536,+32*65536,
  770.         0,+4*65536,+8*65536,+12*65536,+16*65536, +20*65536,+24*65536,+28*65536,+32*65536
  771.     };
  772.     short Wait( ENEMY *ene, short time );
  773.  
  774.     p_anim_num=ene->parent->pt-obj_lboss;
  775.     if( ene->child_death ){
  776.         if( ene->parent->child_death )
  777.             return (0);        /* 消去 */
  778.         else{
  779.             if( ene->parent->work3 ){    /* ラスボス復帰で砲台も復活 */
  780.                 ene->x = ((ene->lx = ene->parent->lx+ene->move_ax) >> 16)-8;    /*-8は表示位置をずらすため*/
  781.                 ene->y = ((ene->ly = ene->parent->ly+ene->move_ay+y[ene->arg][p_anim_num]) >> 16)-8;
  782.                 ene->hp=100;
  783.                 ene->hit_p[0] = &hit_battery_p;
  784.                 ene->child_death=0;
  785.             }
  786.             return(1);
  787.         }
  788.     }
  789.  
  790.     /* 上位ワード(固定整数部)だけ取り出す */
  791.     p_anim_num=ene->parent->pt-obj_lboss;
  792.     ene->x = ((ene->lx = ene->parent->lx+ene->move_ax) >> 16)-8;    /*-8は表示位置をずらすため*/
  793.     ene->y = ((ene->ly = ene->parent->ly+ene->move_ay+y[ene->arg][p_anim_num]) >> 16)-8;
  794.  
  795.     switch (ene->work){
  796.     case 0:        /* 砲身を向ける */
  797.         anim_num=(++ene->anim_count)/8;
  798.         ene->pt = obj_obj+0x30+anim_num;
  799.         if( anim_num == 7 ){
  800.             ene->work++;
  801.             /* 画面外では撃たない */
  802.             if( ENE_X < 16-8 || ENE_X > 255+24 || ENE_Y < 16-8 || ENE_Y > 255+24 )
  803.                 ene->work++;
  804.         }
  805.         break;
  806.     case 1:        /* 自動追尾弾 */
  807.         if( Wait( ene, 60 ) ){
  808.             if(level>=HARD){
  809.                 MakeEShot(ESHOT_HOMING, ENE_X, ENE_Y, 5, angle=calc_direction( ENE_X, ENE_Y, P_X+CENTER_X, P_Y ), 4,0,ene);
  810.                 MakeEShot(ESHOT_HOMING, ENE_X, ENE_Y, 5, (angle-16)&255, 4,0,ene);
  811.                 MakeEShot(ESHOT_HOMING, ENE_X, ENE_Y, 5, (angle+16)&255, 4,0,ene);
  812.                 SetSE(SE_ESHOT_HOMING);    /* 敵ショット音 */
  813.             }
  814.             ene->work++;
  815.         }
  816.         break;
  817.     case 2:        /* 時間稼ぎ */
  818.         if( Wait( ene, 30 ) )
  819.             ene->work++;
  820.         break;
  821.     case 3:        /* 砲身を戻す */
  822.         anim_num=(--ene->anim_count)/8;
  823.         ene->pt = obj_obj+0x30+anim_num;
  824.         if( anim_num == 0 ){
  825.             ene->anim_count=0;
  826.             ene->work++;
  827.         }
  828.         break;
  829.     case 4:        /* 時間稼ぎ */
  830.         if( Wait( ene, 30 ) )
  831.             ene->work=0;
  832.         break;
  833.     }
  834.  
  835.     if( ene->parent->child_death )        /* ラスボスが死んだら砲台も死ぬ */
  836.         ene->damage=100;
  837.     /* ダメージを受けた時の処理 */
  838.     if(ene->damage){
  839.         SetSE(SE_DAMAGE);    /* 効果音 */
  840.         ene->info = PALET_DAMAGE | PRIORITY_BOSS_PARTS | info[ene->arg];
  841.         if( (ene->hp -= ene->damage) <= 0 ){
  842.             MakeEffect(EFFECT_EXPL, 0, ene->x+8, ene->y+8);
  843.             SetSE(SE_EXPL_MBOSS);    /* 爆発音 */
  844.             if(!eshot_erase)
  845.                 eshot_erase = ESHOT_ERASE;    /* 弾消し */
  846.             ene->player->score += 5;
  847.             ene->child_death = 1;
  848. /*            ene->info=0xE00;*/            /* 見えなくする */
  849.             ene->hit_p[0]=NULL;
  850.         }
  851.         ene->damage = 0;
  852.     }else
  853.         ene->info = PALET_MAIN | PRIORITY_BOSS_PARTS | info[ene->arg];
  854.  
  855.     xsp_set_st(ene);
  856.  
  857.     return 1;
  858. }
  859.  
  860. /*
  861. static void TiniEnemyLBoss(ENEMY * p)
  862. {
  863. }
  864. */
  865.